package com.kx.smsplantform.config;

import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration;
import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 配置Zookeeper
 * @Author Sun
 * @Date 2021/7/7 22:13
 */
@Configuration
public class ZookeeperRegistryCenterConfig {
    @Bean
    public CoordinatorRegistryCenter createRegistryCenter() {
        CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(
                new ZookeeperConfiguration("192.168.80.80:2181", "smsplatform-monitor-job"));
        regCenter.init();
        return regCenter;
    }
}
